package com.ss.android.constant;

import android.text.TextUtils;

import com.ss.android.common.constants.NetConstants;

public class UrlHostConstant {

    private static final String API_HOST_API = "isub.snssdk.com";
    private static final String API_HOST_SRV = "ichannel.snssdk.com";
    private static final String API_HOST_SI = "security.snssdk.com";

    public static final String API_URL_PREFIX_API = "https://" + API_HOST_API;
    public static final String API_URL_PREFIX_SRV = "https://" + API_HOST_SRV;
    public static final String API_URL_PREFIX_SI = "https://" + API_HOST_SI;
    public static final String API_URL_PREFIX_AUTO = "https://ib.snssdk.com";

    public static String api(final String path) {
        return API_URL_PREFIX_API + path;
    }

    public static String srv(final String path) {
        return API_URL_PREFIX_SRV + path;
    }

    public static String si(final String path) {
        return API_URL_PREFIX_SI + path;
    }

    public static String auto(final String path) {
        if (!TextUtils.isEmpty(path)
                && path.startsWith("/motor/")) {
            return NetConstants.API_URL_PREFIX_DCAR + path;
        }
        return API_URL_PREFIX_AUTO + path;
    }

}
